<template>
    <div>
        <h1>密码管理</h1>
        <div>{{ num }}</div>
        <button @click="handleclick">add</button>
        <div>{{ name }}</div>
        <button @click="change">change</button>
    </div>
</template>
<script setup>
import {reactive,toRefs} from 'vue'
import { useNumStore } from './store/numStore'
import { storeToRefs } from 'pinia'

const store=useNumStore();
const handleclick=()=>{
    num.value++;
}
const {num}=storeToRefs(store);
const obj=reactive({name:'zs'})
const change=()=>{
    name.value='lisi'
}
const {name}=toRefs(obj);
console.log(name)
</script>
<style>
</style>